﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="UserDetail.aspx.cs" Inherits="WebTeamplate.Admin_UserDetail" %>

<%@ Import Namespace="WebTeamplate" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <link href="../Js/calendar/calendar-win2k-cold-1.css" rel="stylesheet" type="text/css" />

    <script src="../Js/DateFunction.js"></script>

    <script type="text/javascript" src="../Js/calendar/calendar.js"></script>

    <script type="text/javascript" src="../Js/calendar/calendar-setup.js" language="javascript"></script>

    <script type="text/javascript" src="../Js/calendar/lang/calendar-en.js"></script>

    <script type="text/javascript" src="../Js/calendar/lang/calendar-en.js"></script>

    <table class="small" border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td colspan="2" class="detailedViewHeader">
                <b>Thông tin người dùng</b>
            </td>
        </tr>
        <tr class="rowDetail">
            <td colspan="2" class="dvtCellInfo">
                (<span class="commentRequireInput">*</span>): <span class="commentRequireInputText">
                    <%=Resources.Resource.LABEL_COMMENT_REQUIRE %>
                </span>
            </td>
        </tr>
        <tr>
            <td align="left" colspan="2" class="dvtCellErrorMessage">
                <asp:ValidationSummary ID="vsumCategory" CssClass="validateSumary" DisplayMode="BulletList"
                    runat="server" ShowMessageBox="true" ShowSummary="false" />
                <asp:Label ID="lblErrorMessage" runat="server" CssClass="validateSumary"></asp:Label>
            </td>
        </tr>
         <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblRoles" runat="server" Text="Quyền"></asp:Label>(<span class="commentRequireInput">*</span>):
            </td>
            <td class="dvtCellInfo">
                <asp:DropDownList ID="drlRoles" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="drlRoles_SelectedIndexChanged">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="refvRole" ControlToValidate="drlRoles" runat="server"
                    SetFocusOnError="true" Display="Dynamic">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblKho" runat="server" Text="Kho"></asp:Label>:
            </td>
            <td class="dvtCellInfo">
                <asp:DropDownList ID="drlKho" runat="server">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="refvKho" Enabled="false" ControlToValidate="drlKho"
                    runat="server" SetFocusOnError="true" Display="Dynamic">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel" width="150px">
                <asp:Label ID="lblName" runat="server" Text="Họ tên"></asp:Label>(<span class="commentRequireInput">*</span>):
            </td>
            <td class="dvtCellInfo">
                <asp:TextBox ID="txtName" runat="server" Width="150px" MaxLength="50" onblur="this.className='detailedViewTextBox'"
                    onfocus="this.className='detailedViewTextBoxOn'" CssClass="detailedViewTextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="refvName" ControlToValidate="txtName" runat="server"
                    SetFocusOnError="true" Display="Dynamic">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblUserName" runat="server" Text="Tên đăng nhập"></asp:Label>(<span
                    class="commentRequireInput">*</span>):
            </td>
            <td class="dvtCellInfo">
                <asp:TextBox ID="txtUserName" runat="server" Width="150px" MaxLength="50" onblur="this.className='detailedViewTextBox'"
                    onfocus="this.className='detailedViewTextBoxOn'" CssClass="detailedViewTextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="refvUserName" ControlToValidate="txtUserName" runat="server"
                    SetFocusOnError="true" Display="Dynamic">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <%if (this.Command == CommonFunction.DEFAULT_COMMAND_ADD)
          { %>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblPassword" runat="server" Text="Mật khẩu"></asp:Label>(<span class="commentRequireInput">*</span>):
            </td>
            <td class="dvtCellInfo">
                <asp:TextBox ID="txtPassword" runat="server" Width="150px" TextMode="Password" MaxLength="50"
                    onblur="this.className='detailedViewTextBox'" onfocus="this.className='detailedViewTextBoxOn'"
                    CssClass="detailedViewTextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="refvPassWord" ControlToValidate="txtPassword" runat="server"
                    SetFocusOnError="true" Display="Dynamic">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="regvPassword" runat="server" SetFocusOnError="true"
                    ControlToValidate="txtPassword" ErrorMessage="RegularExpressionValidator" Display="Dynamic"
                    ValidationExpression="\w{4,8}">*</asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblConfirmPassword" runat="server" Text="Xác nhận mật khẩu"></asp:Label>(<span
                    class="commentRequireInput">*</span>):
            </td>
            <td class="dvtCellInfo">
                <asp:TextBox ID="txtConfirmPass" runat="server" Width="150px" TextMode="Password"
                    MaxLength="50" onblur="this.className='detailedViewTextBox'" onfocus="this.className='detailedViewTextBoxOn'"
                    CssClass="detailedViewTextBox"></asp:TextBox>
                <asp:RequiredFieldValidator ID="refvConfirmPass" ControlToValidate="txtConfirmPass"
                    runat="server" SetFocusOnError="true" Display="Dynamic">*</asp:RequiredFieldValidator>
                <asp:CompareValidator ID="cpvConfirmpass" runat="server" SetFocusOnError="true" Display="Dynamic"
                    ErrorMessage="CompareValidator" ControlToValidate="txtConfirmPass" ControlToCompare="txtPassword">*</asp:CompareValidator>
            </td>
        </tr>
        <%} %>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label>:
            </td>
            <td class="dvtCellInfo">
                <asp:TextBox ID="txtEmail" runat="server" Width="150px" MaxLength="256" onblur="this.className='detailedViewTextBox'"
                    onfocus="this.className='detailedViewTextBoxOn'" CssClass="detailedViewTextBox"></asp:TextBox>
                <asp:RegularExpressionValidator ID="regvEmail" runat="server" ErrorMessage="RegularExpressionValidator"
                    SetFocusOnError="true" Display="Dynamic" ControlToValidate="txtEmail" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">*</asp:RegularExpressionValidator>
                <%-- <asp:CustomValidator runat="server" ID="cusvEmail" ControlToValidate="txtEmail" ClientValidationFunction="CheckEmailValid">*</asp:CustomValidator>--%>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblBirthDay" runat="server" Text="Ngày sinh"></asp:Label>:
            </td>
            <td class="dvtCellInfo">
                <asp:TextBox ID="txtBirthDay" runat="server" Width="60px" MaxLength="10" onblur="this.className='detailedViewTextBox'"
                    onfocus="this.className='detailedViewTextBoxOn'" CssClass="detailedViewTextBox"></asp:TextBox>
                <img id="imgBirthDay" alt="" title="Ngày sinh" style="cursor: hand; text-align: left;
                    vertical-align: middle; margin-bottom: 4px;" src="../images/imgCalendar.gif" />
                <asp:CustomValidator runat="server" ID="cusvBirthDay" ControlToValidate="txtBirthDay"
                    ClientValidationFunction="CheckInputDate">*</asp:CustomValidator>
                <%--<asp:RequiredFieldValidator ID="refvBirthDay" Display="Dynamic" ControlToValidate="txtBirthDay"
                    runat="server" SetFocusOnError="true">*</asp:RequiredFieldValidator>--%>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblGender" runat="server" Text="Giới tính"></asp:Label>(<span class="commentRequireInput">*</span>):
            </td>
            <td class="dvtCellInfo">
                <asp:DropDownList ID="drlGender" CssClass="small" runat="server">
                </asp:DropDownList>
                <asp:RequiredFieldValidator ID="refvGender" ControlToValidate="drlGender" runat="server"
                    SetFocusOnError="true" Display="Dynamic">*</asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblAddress" runat="server" Text="Địa chỉ"></asp:Label>:
            </td>
            <td class="dvtCellInfo">
                <asp:TextBox ID="txtAddress" runat="server" Width="250px" MaxLength="256" onblur="this.className='detailedViewTextBox'"
                    onfocus="this.className='detailedViewTextBoxOn'" CssClass="detailedViewTextBox"></asp:TextBox>
            </td>
        </tr>
        <tr class="rowDetail">
            <td class="dvtCellLabel">
                <asp:Label ID="lblIsApproved" runat="server" Text="Kích hoạt tài khoản:"></asp:Label>
            </td>
            <td class="dvtCellInfo">
                <asp:CheckBox ID="chkIsApproved" runat="server" />
            </td>
        </tr>
       
        <tr>
            <td>
            </td>
            <td style="height: 40px;" valign="bottom">
                <asp:Button ID="btnSave" runat="server" CssClass="crmbutton 
small edit" Text="Save" OnClick="btnSave_Click" CausesValidation="true" />
                <asp:Button ID="btnCacel" runat="server" CssClass="crmbutton 
small edit" Text="Cancel" OnClick="btnCacel_Click" CausesValidation="false" />
            </td>
        </tr>
    </table>

    <script language="javascript" type="text/javascript">
        var txtBirthDay = document.getElementById("<%= txtBirthDay.ClientID %>");
        SetupCalendar(txtBirthDay.id, "imgBirthDay");
    </script>

    <script type="text/javascript">
        function CheckEmailValid(oSrc, args) {
            var re = new RegExp("\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
            if (args.Value.match(re)) {
                args.IsValid = true;
            } else {
                args.IsValid = false;
            }


        }
    </script>

</asp:Content>
